#include "includes.h"
#include "CSound.h"

VOID CSound::InitCSound() {
	mciSendStringA("open ./res/music/shoot.wav alias shoot0", NULL, 0, NULL);
	mciSendStringA("open ./res/music/PlayerMove.wav alias PlayerMove", NULL, 0, NULL);
	mciSendStringA("open ./res/music/EnemyBomb.wav alias EnemyBomb", NULL, 0, NULL);
}

VOID CSound::PlayCSound(CSoundID id) {
	switch (id)
	{
	case CSound::Shoot0:		mciSendStringA("play shoot0 from 0", NULL, 0, NULL); break;
	case CSound::PlayerMove:	mciSendStringA("play PlayerMove from 0", NULL, 0, NULL); break;
	case CSound::EnemyBomb:		mciSendStringA("play EnemyBomb from 0", NULL, 0, NULL); break;
	default:					break;
	}
}

VOID CSound::PauseCSound(CSoundID id) {
	switch (id)
	{
	case CSound::Shoot0:		mciSendStringA("pause shoot0", NULL, 0, NULL); break;
	case CSound::PlayerMove:	mciSendStringA("pause PlayerMove", NULL, 0, NULL); break;
	case CSound::EnemyBomb:		mciSendStringA("pause EnemyBomb", NULL, 0, NULL); break;
	default:					break;
	}
}

VOID CSound::CloseCSound() {
	mciSendStringA("close shoot0", NULL, 0, NULL);
	mciSendStringA("close PlayerMove", NULL, 0, NULL);
	mciSendStringA("close EnemyBomb", NULL, 0, NULL);
}
